<template>
	<view class="whitepaper page-main">
		<view class="title">
			<router-link :underline="false" :to="{ path: '/pages/user/index' }"><span class="arrowLeft"></span></router-link>
			<span class="name">白皮書</span>
			<span></span>
		</view>
	</view>
</template>

<script>
import authMixin from '@/mixins/auth'
import { getToken } from '@/utils/auth'

export default {
	mixins: [authMixin],
	data() {
		return {
		}
	},
	methods: {
		async getContent() {
			let params = {
				token: getToken(),
				type: '1'
			}
			const {code, data} = await this.$api.my.getimgType(params)
			console.log(code, data)
			if(code === 200) {
				this.openPdfFileByUrl(data.zh)
			}
		},
		openPdfFileByUrl(pdfUrl) {
			uni.openDocument({
				filePath: pdfUrl,
				fileType: "pdf",
				success: function (res) {
					console.log("open success");
				}
			})
		}
	},
	mounted() {
		this.getContent()
	}
}
</script>

<style lang="scss" scoped>
.whitepaper {
	a{
		text-decoration: none;
		color: #333;
	}
	padding:0 40rpx;
	position: relative;
	height: 100%;
	background: #000002;
	.title{
		width:100%;
		padding:20rpx;
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		.arrowLeft{
			display: inline-block;
			background:url(@/static/images/user/left.png) no-repeat 0 10rpx;
			width:50rpx;
			height:50rpx;
			background-size:100%;
		}
		.name{
			font: 500 36rpx/60rpx PingFangSC;
		}
		
	}
}
</style>
